<?php include('./templete/public/head.php') ?>

<body>

<!--金点子排行-->
<div class="idea-rank-main">
    <img src="_images/rank-bg.jpg" class="rank-bg"/>
    <div class="rank-content">
        <div class="c-top">
            <a href="<?php echo url('rank', ['type' => 1]) ?>"
               <?php if ($type == 1){ ?>class="active" <?php } ?>>个人榜</a>
            <a href="<?php echo url('rank', ['type' => 2]) ?>"
               <?php if ($type == 2){ ?>class="active" <?php } ?>>部门榜</a>
            <a href="<?php echo url('rank', ['type' => 3]) ?>"
               <?php if ($type == 3){ ?>class="active" <?php } ?>>月度五佳</a>
            <a href="<?php echo url('rank', ['type' => 4]) ?>"
               <?php if ($type == 4){ ?>class="active" <?php } ?>>年度十佳</a>
            <!--
            <a href="<?php //echo url('rank', ['type' => 5]) ?>"
               <?php if ($type == 5) { ?>class="active" <?php } ?>>奖金榜</a>
               -->
        </div>
        <div class="c-bot">
            <div class="mui-slider">
                <div class="mui-control">
                    <div class="top_nav">

                        <a href="<?php echo url('rank', ['type' => $type, 'model' => 1]) ?>"
                           class="<?php if ($model == 1) { ?>mui-active <?php } ?>">
                            <span>提议数量</span>
                        </a>

                        <a href="<?php echo url('rank', ['type' => $type, 'model' => 3]) ?>"
                           class=" <?php if ($model == 3) { ?>mui-active <?php } ?>">
                            <span>实施次数</span>
                        </a>

                    </div>
                    <div class="mui-slider-group">
                        <!--1-->
                        <div class="mui-slider-item mui-control-content">
                            <ul class="rank-list">
                                <?php foreach ($list as $k => $v) { ?>

                                    <li class="rank-item">
                                        <div class="progress" style="margin-left: 0px" id="progress<?php echo $k ?>">
                                            <p><?php echo $v['name'] ?>
                                                <span class="integral"><?php echo $v['count'] ?></span><span>次</span>
                                            </p>
                                            <p class="mui-progressbar mui-progressbar-in">
                                                <span></span>
                                            </p>
                                        </div>
                                    </li>

                                <?php } ?>

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    //进度
    (function () {
        var progressbar1 = $("[id^='progress']");// mui('#progress^');
        var first = $('#progress0').find('.integral').text();
        console.log(first);
        for (var i = 0; i < progressbar1.length; i++) {
            let integral = $('#progress' + i).find('.integral').text();
            mui(progressbar1[i]).progressbar().setProgress(integral * 100 / first)
        }
    })(mui);
    var topheight = $(".rank-list").offset().top;
    var height = $(window).height() - topheight - 30;
    $(".mui-slider-group").css("height", height)

</script>

</html>